<template>
  <div class="page bgc-fff">
    <!-- title -->
    <div class="mt30 pad-l-r15">
      <img class="icon-succ" :src="staticImgData.imgurla" alt="">
      <div v-if="logintype === 'company'" class="mt20 f20 c-000">注册成功</div>
      <div v-else class="mt20 f20 c-000">申请成功</div>
      <div v-show="logintype === 'driver'" class="mt15 f12 c-666">申请加入信息待审核，现在可登录完善个人及车辆信息！</div>
      <div v-show="logintype === 'company'" class="mt15 f12 c-666">注册信息待审核，现在可登录完善公司信息！</div>
    </div>
    <div class="mt50 pad-l-r15">
      <p class="large-btn"  :class="[{'bgc-7cbdff':!disabled}]" @click="subAxios">登录</p>
    </div>


    <v-loading  v-show="loadingShow"></v-loading>
  </div>
</template>

<script type="text/ecmascript-6">
  import Loading from '@/components/common/loading/loading.vue'
  import * as ThreeStorage from '@/utils/store/token.js'
  import { mapGetters } from 'vuex'
  export default {
    name: 'signup-success',
    data() {
      return {
        logintype: '', // 司机 dirver or 公司 company 用于辨别是司机登录 还是公司登录
        staticImgData: {
          imgurla: require('@/assets/image/common/user.png')
        },
        nums: 15,
        loginParam: {
          username: '',
          password: ''
        },
        // loadingShow: 0, // loading显隐
        disabled: false, // 登录禁止点击
        loadingFail: false
      }
    },
    components: {
      'v-loading': Loading
    },
    computed: {
      ...mapGetters(['loadingShow'])
    },
    created() {
      this.loginParam = {
        username: this.$route.params.toParam.mobile,
        password: this.$route.params.toParam.password
      }
      this.logintype = ThreeStorage.getLoginType()
    },
    mounted() {

    },
    methods: {
      subAxios: function() {
        // 公共验证
        const that = this
        const toParam = {
          username: that.loginParam.username,
          password: that.loginParam.password
        }
        that.$store.dispatch('Login', toParam)
      }
    }
  }
</script>

<style scoped>
  @import '../../styles/util.css';
  /* common */
  .large-btn.bgc-7cbdff{
    background-color: #7cbdff;
  }
  .input-cells>input{
    text-align: left ;
  }
  .large-btn{
    background-color: #dedede;
  }
  .icon-succ{
    margin-left: auto;
    margin-right: auto;
    width: .8rem;
    height: .8rem;
  }
  /* line */
  .flex>span{
    display: block;
  }
</style>
